package com.example.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class ProxyWithAnnotationTest {
    public void test(){
        System.out.println("你好");
        throw new RuntimeException("112");
    }
    public static void main(String[] args) {
        ApplicationContext context=new AnnotationConfigApplicationContext(AnnotationAopConfiguration.class);
        ProxyWithAnnotationTest proxyWithAnnotationTest = context.getBean("proxyWithAnnotationTest", ProxyWithAnnotationTest.class);
        proxyWithAnnotationTest.test();
    }
}
